<?php


namespace app\management\model;


use think\Model;

class EveryTimes extends Model
{

    protected $pk="id";
    protected $table = "every_times";

    public function searchDomainAttr($query, $value, $data)
    {

        return $value?$query->where('domain','in', $value):'';
    }

    public function searchCreateTimeAttr($query, $value, $data)
    {
        $times = [];
        if ($value){
            $times = cut_time($value);
        }
        return $value?$query->whereBetweenTime('create_time', $times['bTime'], $times['eTime']):'';
    }

    // 获取器转换时间
    public function getTimeAttr($time){
        return $time = gmdate('H:i:s', $time);
    }

}
